<template>
	<div class="header">
	<div class="back_btn" v-if="hiddenFoot" @click="back">
		<i class="iconfont icon-back"></i>
	</div>
		<h1>{{hTitle}}</h1>
	</div>
</template>

<script>

export default{
	computed:{
		hTitle(){
//			访问vueX里面的state来拿到唯一的值
			return this.$store.state.hTitle

		},
		hiddenFoot(){
				return this.$store.state.hiddenFoot
		}
	},
	methods:{
		back(){
			console.log(this)
			this.$router.go(-1)
		}
	},
	mounted(){
		
	}
}
</script>

<style lang="scss"  >
	*{
		margin: 0;
		padding: 0;
	}
.header{
	z-index: 999;
	position:fixed;
	top: 0;
	width: 100%;
	height: 50px;
	background-color: #e54847;
	text-align: center;
	h1{
		font-size: 18px;
		color: white;
		line-height: 50px;
		font-weight: 500;
	}
	.back_btn{
		position: fixed;
		top: 10px;
		left: 8px;
		
		.iconfont{
			font-size: 25px;
			color: white;
		}
		
	}
}
</style>